package common.fengkai.filepost.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.mysql.cj.log.Log;
import common.fengkai.filepost.bean.mysqlBean.EmpUser;
import common.fengkai.filepost.dao.mysqldao.ExtEmpUserMapper;
import common.fengkai.filepost.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Fengkai
 * @creat 2022/9/16
 */
@Service
public class TestServiceImpl implements TestService {

    @Autowired
    private ExtEmpUserMapper empUserMapper;

    @Override
    public void selectByIds () {
        HashSet<String> strings = new HashSet<>();
        strings.add("a");
        strings.add("b");
        strings.add("c");
        strings.add("d");
        strings.add("e");
        strings.add("f");
        strings.add(null);

        ArrayList<String> strings1 = new ArrayList<>();
        strings1.add("a");
        strings1.add("b");
        strings1.add("c");
        strings1.add("d");
        strings1.add("e");
        strings1.add("f");
        strings1.add(null);

        List<String> collect = strings.stream().filter(v -> v != null).collect(Collectors.toList());
        List<EmpUser> empUserList = empUserMapper.selectByIds(strings);
        System.out.println(JSONObject.toJSONString(empUserList));

    }
}
